package io.renren.modules.generator.dao;

import io.renren.common.vo.ProductExportVo;
import io.renren.modules.generator.entity.AddressProductEntity;
import io.renren.modules.generator.entity.ProductEntity;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 
 * 
 * @author chenshun
 * @email sunlightcs@gmail.com
 * @date 2018-11-06 15:11:23
 */
@Mapper
public interface ProductDao extends BaseMapper<ProductEntity> {

    ProductEntity queryEntityById(@Param("id") int id);

    List<ProductEntity> queryPage(Map<String, Object> params);


    int queryPageTotal(Map<String, Object> params);

    List<AddressProductEntity> queryProductAddressByProductId(int id);

    List<ProductEntity> queryByCustomerIdAndFromAddressId(@Param("customerId") Integer customerId, @Param("fromAddressId") Integer fromAddressId);

    ProductEntity queryEntityByProductNumberAndCustomerIdAndAddressId(Map<String, Object> params);

    List<ProductExportVo> queryDataForExcel(Map<String, Object> params);

    int queryTotalForExcel(Map<String, Object> params);
}
